package com.ahearttogo.executor;

import com.ahearttogo.binding.MapperMethod;
import com.ahearttogo.executor.Executor;
import com.ahearttogo.session.Configuration;
import com.ahearttogo.statement.StatementHandler;
import sun.security.krb5.Config;

/**
 * @author xiejialin
 * @date 2020/4/22 9:06 AM
 */
public class SimpleExecutor implements Executor {

    private Configuration configuration;

    public SimpleExecutor(Configuration configuration) {
        this.configuration = configuration;
    }

    @Override
    public <T> T query(MapperMethod method, Object parameter) throws Exception
    {
        StatementHandler statementHandler = new StatementHandler(configuration);
        return statementHandler.query(method,parameter);
    }
}
